﻿package frEngine.shader.md5shader
{
    import flash.display3D.*;
    import flash.events.*;
    import frEngine.core.*;
    import frEngine.shader.filters.fragmentFilters.*;
    import frEngine.shader.filters.vertexFilters.*;
    import frEngine.shader.registType.*;

    public class ShadowShader extends Md5ShaderBase
    {
        private var colorReg:FcParam;

        public function ShadowShader(param1:int, param2:VertexFilter, param3:FragmentFilter)
        {
            super(param1, param2, param3);
            this.materialParams.setBlendMode(EBlendType.BLEND_ALPHA3);
            this.materialParams.depthCompare = Context3DCompareMode.ALWAYS;
            this.materialParams.depthWrite = false;
            this.materialParams.isOpenHerizionKil = true;
            return;
        }// end function

        override protected function materialRebuilder(event:Event) : void
        {
            super.materialRebuilder(event);
            this.colorReg = getParam("{COLOR}", false);
            return;
        }// end function

        public function changeParams(param1:Number) : void
        {
            if (this.colorReg)
            {
                this.colorReg.changeValue1(3, param1 * 0.3);
            }
            return;
        }// end function

    }
}
